import type { GreasyForkElements } from '../../../../../../../../types/constants/personalization/greasy_fork'
import {
  BLOCKQUOTE_STYLES,
  PAGE_ELEMENTS,
  PROJECT_PREFIX,
  SUPPORTED_PLATFORMS,
} from '../../../../../../../../types/constants'
import { CommonPage } from './common'

// 测试链接：https://greasyfork.org/zh-CN/reports/85781
export class ReportsPage {
  elements: GreasyForkElements = PAGE_ELEMENTS[SUPPORTED_PLATFORMS.GREASY_FORK]
  private static instance: ReportsPage
  private readonly commonPage: CommonPage = CommonPage.getInstance()

  /**
   * 获取单例实例
   */
  public static getInstance(): ReportsPage {
    if (!ReportsPage.instance) {
      ReportsPage.instance = new ReportsPage()
    }
    return ReportsPage.instance
  }

  init(): void {
  }

  getMainStyles(): string {
    return `
.text-content {
  background-color: var(--${PROJECT_PREFIX}-theme-bg-base) !important;
  border: none !important;
  box-shadow: none !important;
  margin-top: 0 !important;
  color: var(--${PROJECT_PREFIX}-theme-text-secondary) !important;
  
  a {
    ${this.commonPage.linkStyles()}
  }
  
  h4 {
    margin-top: 0 !important;
    padding-top: 1.33em !important;
    color: var(--${PROJECT_PREFIX}-theme-text-primary) !important;
  }
  
  blockquote {
    ${BLOCKQUOTE_STYLES.BASE}
    .user-content {
      color: var(--${PROJECT_PREFIX}-theme-text-secondary) !important;
      background: transparent !important;
      border: none !important;
      border-left: none !important;
    }
  }
}
`
  }
}
